package com.cd.music.controller;

import com.cd.music.annotation.Auth;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 官网freemarker模板路由跳转
 *
 * @author zhangjun
 */
@Controller
@CrossOrigin
public class MenuController {
    /**
     * 登录
     *
     * @return
     */
    @RequestMapping("home/login")
    public String login() {
        return "login";
    }


    /**
     * 购买页
     *
     * @return
     */
    @Auth(roles = "user", sign = {2}, description = "用户和管理员都可以访问")
    @RequestMapping("home/deal")
    public String deal() {
        return "order/deal";
    }


    /**
     * 音乐详情页
     *
     * @return
     */
    @RequestMapping("home/musicBox")
    public String musicBox() {
        return "musicBox";
    }

    /**
     * 注册页
     *
     * @return
     */
    @RequestMapping("home/register")
    public String register() {
        return "register";
    }

    /**
     * 保存注册请求表单
     *
     * @return
     */
    @RequestMapping("home/registers")
    public String registers() {
        return "login";
    }

    /**
     * 更改密码
     *
     * @return
     */
    @RequestMapping("home/update-pwd")
    public String updatePWD() {
        return "update_pwd";
    }

    /**
     * 更改密码成功
     *
     * @return
     */
    @RequestMapping("home/update-success")
    public String updateSuccess() {
        return "update_success";
    }

}
